/*
 * Copyright 2010 Assert Developments
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * 	http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package be.ad.coffeebreak.web.exceptions;

import be.ad.coffeebreak.web.WebConstants;

import javax.servlet.http.HttpServletResponse;

/**
 * An exception representing an http forbidden.
 * Handled by the exception filter.
 *
 * @author Stefan Bangels
 * @see be.ad.coffeebreak.web.ExceptionFilter
 */
public class ForbiddenException extends HttpException {

    /**
     * Default constuctor.
     */
    public ForbiddenException() {
    }

    /**
     * Constructor providing an error message.
     *
     * @param message the error message
     */
    public ForbiddenException(String message) {
        super(message);
    }

    /**
     * Constructor providing an error message and cause exception.
     *
     * @param message the error message
     * @param cause   the cause exception
     */
    public ForbiddenException(String message, Throwable cause) {
        super(message, cause);
    }

    /**
     * Constructor providing a cause exception.
     *
     * @param cause the cause exception
     */
    public ForbiddenException(Throwable cause) {
        super(cause);
    }

    /**
     * Get the http error status code.
     *
     * @return the http error status code
     */
    @Override
    public int getStatusCode() {
        return HttpServletResponse.SC_FORBIDDEN;
    }

    /**
     * Get the view that describes the error.
     *
     * @return the error view
     */
    @Override
    public String getView() {
        return WebConstants.VIEW_FORBIDDEN;
    }

}
